//
//  Student.m
//  OC4_属性&字符串
//
//  Created by dllo on 15/10/27.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "Student.h"

@implementation Student

//- (NSString *)name
//{
//    return _name;
//}
//
//- (void)setName:(NSString *)name
//{
//    _name = name;
//}
//- (NSString *)sex
//{
//    return _sex;
//}
//- (void)setSex:(NSString *)sex
//{
//    _sex = sex;
//}
//- (NSInteger)age
//{
//    return _age;
//}
//- (void)setAge:(NSInteger)age
//{
//    _age = age;
//}
//- (CGFloat)score
//{
//    return _score;
//}
//- (void)setScore:(CGFloat)score
//{
//    _score = score;
//}

- (id)initWithName:(NSString *)name sex:(NSString *)sex age:(NSInteger)age score:(CGFloat)score
{
    self = [super init];
    if (self) {
        [self setName:name];
        [self setSex:sex];
        [self setAge:age];
        [self setScore:score];
    }
    return self;
}

+ (id)studentWithName:(NSString *)name sex:(NSString *)sex age:(NSInteger)age score:(CGFloat)score
{
    Student *stu = [[Student alloc] initWithName:name sex:sex age:age score:score];
    return stu;
}

- (void)info
{
    NSLog(@"%@ %@ %ld %.2f", [self name], [self sex], [self age], [self score]);
}


@end
